{% comment %}
- repo
- snapshot
{% endcomment %}

  <table class="table table-condensed">
    <tr>
      <td style="width:100px;" class="text-right"><b>Checkout URI</b></td>
      <td><a class="label label-default" href="{{repo.uri}}">{{repo.uri}}</a></td>
    </tr>
    <tr>
      <td class="text-right"><b>VCS Type</b></td>
      <td><span class="label label-default">{{repo.type}}</span></td>
    </tr>
    <tr>
      <td class="text-right"><b>VCS Version</b></td>
      <td><span class="label label-default">{{snapshot.version}}</span></td>
    </tr>
    <tr>
      <td style="white-space: nowrap;" class="text-right"><b>Last Updated</b></div>
      <td>
        {% if snapshot.data.last_commit_time %}
          <span class="label label-default"><span class="glyphicon glyphicon-time"></span> {{snapshot.data.last_commit_time}}
        {% else %}
          <span class="label label-warning">UNKNOWN
        {% endif %}</span>
      </td>
    </tr>
    <tr>
      <td class="text-right"><b>Dev Status</b></td>
      <td>
        {% if repo.status %}
          {% if repo.status == 'maintained' %}
            <span class="label label-primary">
          {% elsif repo.status == 'developed' %}
            <span class="label label-success">
          {% elsif repo.status == 'end-of-life' %}
              <span class="label label-danger">
          {% endif %}
          {{repo.status | upcase}}
        {% else %}
          <span class="label label-warning">UNMAINTAINED
        {% endif %}</span>
      </td>
    </tr>
              <tr>
                <td class="text-right"><b>CI status</b></td>
                <td class="ci-status">
                  {% assign ci_data = package.data.ci_data %}
                  {% if ci_data.ci_available %}
                    {% if ci_data.history_available %}
                      <div class="dropdown">
                        <button type="button" data-toggle="dropdown" class="btn label label-primary dropdown-toggle ci-result-{{ ci_data.result }}" title="{{ ci_data.tooltip }}">
                          <span class="glyphicon glyphicon-check"></span>
                          Continuous Integration
                          {% if ci_data.stats_available %}
                            : {{ ci_data.tests_ok }} / {{ ci_data.tests_total }}
                          {% endif %}
                          <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                          <li class="dropdown-header">Latest build history: {{ ci_data.timestamp }} (last {{ ci_data.history.size }} of {{ ci_data.total_builds }} builds)</li>
                          {% for build in ci_data.history %}
                            <li class="ci-build-info ci-result-{{ build.result }}">
                              <a href="http://build.ros.org/{{ build.uri }}" target="_blank">
                                <span class="glyphicon glyphicon-{{ build.icon }}"></span>
                                <span><strong>#{{ build.id }}</strong></span>
                                <span>{{ build.timestamp }}</span>
                                <span>{{ build.tests_ok }} / {{ build.tests_total }}</span>
                              </a>
                            </li>
                          {% endfor %}
                        </ul>
                      </div>
                    {% else %}
                      <a href="{{ ci_data.job_url }}" class="label ci-result-{{ ci_data.result }}" title="{{ ci_data.tooltip }}">
                        <span class="glyphicon glyphicon-check"></span>
                        Continuous Integration
                        {% if ci_data.stats_available %}
                          : {{ ci_data.tests_ok }} / {{ ci_data.tests_total }}
                        {% endif %}
                      </a>
                    {% endif %}
                  {% else %}
                    <span class="label label-default" title="{{ ci_data.tooltip }}">No Continuous Integration</span>
                  {% endif %}
                </td>
              </tr>
    <tr>
      <td class="text-right"><b>Released</b></td>
      <td>
        {% if snapshot.released %}
          <span class="label label-primary"><span class="glyphicon glyphicon-flash"></span> RELEASED
        {% else %}
          <span class="label label-default">UNRELEASED
        {% endif %}</span>
      </td>
    </tr>
    <tr>
      <td class="text-right"><b>Tags</b></td>
      <td>
        {% assign n_tags = repo.tags.size %}
        {% if n_tags > 0 %}
          {% for tag in repo.tags %}<span class="label label-default">{{ tag }}</span> {% endfor %}
        {% else %}
          <em>No category tags.</em>
        {% endif %}
      </td>
    </tr>
    <tr>
      <td class="text-right"><b>Contributing</b></td>
      <td>
        <a class="label label-primary" href="/r/{{repo.name}}/#{{distro}}-contribute-lists-help-wanted">
          Help Wanted (<span class="contribute-lists-help-wanted-count">0</span>)
        </a>
        <br>
        <a class="label label-primary" href="/r/{{repo.name}}/#{{distro}}-contribute-lists-good-first-issue">
          Good First Issues (<span class="contribute-lists-good-first-issue-count">0</span>)
        </a>
        <br>
        <a class="label label-primary" href="/r/{{repo.name}}/#{{distro}}-contribute-lists-pull-requests">
          Pull Requests to Review (<span class="contribute-lists-pull-requests-count">0</span>)
        </a>
      </td>
    </tr>
  </table>
